package com.thinkTank.oa.service.impl;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkTank.oa.base.BaseServiceImpl;
import com.thinkTank.oa.dao.SubscribeMapper;
import com.thinkTank.oa.entity.Subscribe;
import com.thinkTank.oa.service.SubscribeService;
@Transactional
@Service("subscribeService")
public class SubscribeServiceImpl extends BaseServiceImpl<Subscribe> implements  SubscribeService {


	public SubscribeMapper getSubscribeMapper() {
		return (SubscribeMapper)super.getBaseMapper();
	}
	/***
	 * 必须实例化 否则不能调用basedao里面的公用方法
	 * @param userMapper
	 */
	@Autowired	
	public void setSubscribeMapper(SubscribeMapper subscribeMapper) {
		super.setBaseMapper(subscribeMapper);
	}
	@Override
	public Subscribe findSubByUserIdAndType(String userid, String typeObject,Integer subType) {
		
		return this.getSubscribeMapper().findSubByUserIdAndType( userid, typeObject,subType);
	}
	@Override
	public List<Subscribe> findAllSubByUserId(String userId) {
	
		 return this.getSubscribeMapper().findAllSubByUserId(userId);
	}

	@Override
	public int deleteByObj(Subscribe sub) {
		return getSubscribeMapper().deleteByObj(sub);
	}
	
}
